﻿<%@ page language="java" import="com.newcrm.config.Const,com.newcrm.util.Util,com.newcrm.bean.*,java.util.List,java.util.Map" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%
  User user = (User) session.getAttribute("user");
  Map<Integer, CompanyInfo> companys = (Map<Integer, CompanyInfo>) application.getAttribute(Const.APPLICATION_COMPANYS);
  CompanyInfo companyInfo = companys.get(Integer.valueOf(user.companyId));
  List<Map<String, Object>> companyTags = companyInfo.tags;
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
  <title>标签管理</title>
  <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
  <meta name="renderer" content="webkit"/>
  <meta http-equiv="X-UA-Compatible" content="IE=Edge">
  <link rel="shortcut icon" href="<%=request.getContextPath()%>/images/qikebao.ico" />
  <link rel="stylesheet" href="<%=request.getContextPath()%>/css/all.css?ver=<%=Const.VERSION%>">
  <link rel="stylesheet" href="<%=request.getContextPath()%>/css/font-awesome/css/font-awesome.min.css">
  <link rel="stylesheet" href="<%=request.getContextPath()%>/css/datepicker.css" />
  <link rel="stylesheet" href="<%=request.getContextPath()%>/css/bootstrap-datetimepicker.min.css" />
  <link rel="stylesheet" href="<%=request.getContextPath()%>/css/magnific-popup.css">
  <script type="text/javascript" src="<%=request.getContextPath()%>/script/jquery-1.11.1.min.js"></script>
  <script type="text/javascript" src="<%=request.getContextPath()%>/script/bootstrap.min.js"></script>
  <script type="text/javascript" src="<%=request.getContextPath()%>/script/jquery-ui.min.js"></script>
  <script type="text/javascript" src="<%=request.getContextPath()%>/script/jquery.bootstrap-growl.min.js"></script>
  <script type="text/javascript" src="<%=request.getContextPath()%>/script/moment.min.js"></script>
  <script type="text/javascript" src="<%=request.getContextPath()%>/script/bootstrap-datepicker.js"></script>
  <script type="text/javascript" src="<%=request.getContextPath()%>/script/bootstrap-datetimepicker.min.js"></script>
  <script type="text/javascript" src="<%=request.getContextPath()%>/script/daterangepicker.js"></script>
  <script type="text/javascript" src="<%=request.getContextPath()%>/script/jquery.magnific-popup.min.js"></script>
  <script type="text/javascript" src="<%=request.getContextPath()%>/script/jquery.cookie.js"></script>
  <script type="text/javascript" src="<%=request.getContextPath()%>/script/popbox.js"></script>
  <script type="text/javascript" src="<%=request.getContextPath()%>/script/common.js?ver=<%=Const.VERSION%>"></script>
  <script type="text/javascript" src="<%=request.getContextPath()%>/script/tag.js?ver=<%=Const.VERSION%>"></script>
</head>
<body class="parties">
  <jsp:include page="topNavi.jsp" flush="true"/>
  <div class="main-page">
    <table>
    <tr>
      <td class="main-body">
        <div class="topnavi">
          <div class='leftMenu'><span>标签管理</span></div>
        </div>
        <div class="grid">
          <div class="new">
            <form class="new" method="post" >
              添加新的标签<br />
              <input autocomplete="off" class="name" maxlength="25" id="tagName" size="30" type="text" value="" />
              <span id="new_submit" class="submit"> <a id="new-link" class="button small blue" href="#"><i class="fa fa-plus"></i> 添加</a></span>
            </form>
          </div>
          <ul class="items nomove" id="itemlist">
            <%if (companyTags != null) {
                for (Map<String, Object> tag:companyTags) {
                %>
            <li class="item">
              <div class="edit">
                <div><input autocomplete="off" maxlength="25" class="name" size="30" type="text" value="<%=Util.HTMLEncode((String)tag.get("TagName"))%>" /></div>
                <span class="submit">
                  <a class="button small blue" href="<%=tag.get("TagId")%>"><i class="fa fa-pencil"></i> 修改</a>
                  <a class="admin" href="#">取 消</a>
                </span>
              </div>
              <div class="show">
                <div class="name"><%=Util.HTMLEncode((String)tag.get("TagName"))%></div>
                <ul class="controls">
                  <li><a class="admin" href="#">修改</a></li>
                  <li><a title="删除标签" class="delete" href="<%=tag.get("TagId")%>"><i class="fa fa-trash-o"></i> &nbsp;</a></li>
                </ul>
              </div>
            </li>
            <%
              }
            }
            %>
          </ul>
        </div>
      </td>
      <td class="main-sidebar">
        <div class="content">
          <div class="liner">
            <div class="sidebox closedbox">
              <h5>标签的作用</h5>
              <p>可以通过给客户设置标签来区分不同的客户。</p>
            </div>
          </div>
        </div>
      </td>
    </tr>
    </table>
  </div>

  <li class="item" id="clone" style="display:none;">
    <div class="edit">
      <div><input autocomplete="off" maxlength="25" class="name" size="30" type="text" value="" /></div>
      <span class="submit">
        <a class="button small blue" href="#"><i class="fa fa-pencil"></i> 修改</a>
        <a class="admin" href="#">取 消</a>
      </span>
    </div>
    <div class="show">
      <div class="name"></div>
      <ul class="controls">
        <li><a class="admin" href="#">修改</a></li>
        <li><a title="删除标签" class="delete" href="#"><i class="fa fa-trash-o"></i> &nbsp;</a></li>
      </ul>
    </div>
  </li>
</body>
</html>